/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package net.asik.hotitemscanner.mvc;

import java.util.LinkedHashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import net.asik.hotitemscanner.bean.HotItem;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 *
 * @author asikprad
 */
@Controller
public class HotitemController {

    @RequestMapping(value = "/scanner", method = RequestMethod.GET)
    public String scanner(HttpServletRequest request) {
        return "scanner";
    }

    @RequestMapping(value = "/scan", method = RequestMethod.GET)
    public @ResponseBody
    Map<String, ? extends Object> getHotItemList() {
        Map<String, HotItem> returnList = new LinkedHashMap<>();
        returnList.put("CAS", new HotItem("CAS", "abcd.xhtml"));
        returnList.put("guest", new HotItem("guest", "aprg.xhtml"));
        return returnList;

    }

    @RequestMapping(value = "/regScanner")
    public String regexScanner() {
        return "regScanner";
    }
}
